﻿namespace KnownCMS.Admin.Pages.Interact;

[Route("/ims/logs")]
[Menu(AppAdmin.Interact, "操作日志", "clock-circle", 4)]
public class ImLogList : BaseTablePage<CmLog>
{
    private IPostService Service;

    protected override async Task OnInitPageAsync()
    {
        await base.OnInitPageAsync();
        Service = await CreateServiceAsync<IPostService>();
        Table.OnQuery = Service.QueryLogsAsync;

        Table.AddColumn(c => c.BizType).Width(110);
        Table.AddColumn(c => c.LogType).Width(110);
        Table.AddColumn(c => c.BizId);
        Table.AddColumn(c => c.UserId).Width(100);
        Table.AddColumn(c => c.UserIP).Width(120);
        Table.AddColumn(c => c.CreateTime, true).Name("创建时间").Type(FieldType.DateTime).Width(140);
    }

    [Action] public Task Export() => Table.ExportDataAsync();
}